/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package com.dejax.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hibernate.annotations.*;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author Richer
* @date 2022-01-07
**/
@Entity
@Data
@EntityListeners(AuditingEntityListener.class)
@Table(name="devops_workorderdetail")
public class DevopsWorkorderdetail implements Serializable {

    @Id
    @Column(name = "workorderdetailid")
    @ApiModelProperty(value = "workorderdetailid")
    private String workorderdetailid;

    @Column(name = "workorderid")
    @ApiModelProperty(value = "workorderid")
    private String workorderid;

    @Column(name = "operationid",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "操作详情")
    private String operationid;

    @Column(name = "operateparams",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "操作参数")
    private String operateparams;

    @Column(name = "operateresult")
    @ApiModelProperty(value = "执行结果")
    private String operateresult;

    @Column(name = "operatetime")
    @ApiModelProperty(value = "操作时间")
    private Timestamp operatetime;

    @Column(name = "flag")
    @ApiModelProperty(value = "flag")
    private Integer flag;

    @Column(name = "notes")
    @ApiModelProperty(value = "notes")
    private String notes;

    @CreatedBy
    @Column(name = "reguser", updatable = false)
    @ApiModelProperty(value = "创建者", hidden = true)
    private String reguser;

    @CreationTimestamp
    @Column(name = "regtime", updatable = false)
    @ApiModelProperty(value = "创建时间", hidden = true)
    private Timestamp regtime;

    @LastModifiedBy
    @Column(name = "moduser")
    @ApiModelProperty(value = "修改人", hidden = true)
    private String moduser;

    @UpdateTimestamp
    @Column(name = "modtime")
    @ApiModelProperty(value = "修改时间", hidden = true)
    private Timestamp modtime;

    public void copy(DevopsWorkorderdetail source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}